<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import type { ResourceItem } from '@/types/home'
const latest_resource_list = ref<ResourceItem[]>([])
// 组件挂载完毕
// onMounted(() => {
// mathFormula.value = '$$ a^2 - \frac{1}{2} $$'
// console.log('父组件公式：', mathFormula)
// })
// 页面加载
onLoad(async () => {
  console.log('父组件页面加载')
})
</script>

<template>
  <view class="container">
    <view class="header">
      <text>最新</text>
      <text>今日新增x份</text>
    </view>
    <view class="body" v-for="item in latest_resource_list" :key="item.id">
      <view class="left">
        <image
          style="width: 200px; height: 200px; background-color: #eeeeee"
          mode="aspectFit"
          src="@/static/images/logo.png"
        />
      </view>
      <view class="right">
        <text>{{ item.name }}</text>
        <view class="two_item">
          <text>{{ item.charge_type }}</text>
          <text>{{ item.date }}</text>
        </view>
        <view class="tow_item">
          <text>{{ item.publish }}</text>
          <text>{{ item.download_total }}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<style lang="scss"></style>
